import axios from "axios";
import { config } from "vue/types/umd";

const axiosInstance = axios.create({
    timeout: 30000,
    withCredentials: false
})

axiosInstance.interceptors.request.use(
    config => {
        return config;
    },
    error => {
        return Promise.reject(error);
    }
)

axiosInstance.interceptors.response.use(
    resp => {
        if(resp.status == 200){
            return resp.data;
        } else {
            return Promise.reject(resp);
        }
    },
    error => {
        return Promise.reject(error);
    }
)

export default axiosInstance